import { observable, action, autorun, toJS } from 'mobx';
import { WeaTableNew, WeaForm } from 'comsMobx';
import { WeaLocaleProvider } from 'ecCom';
import { message, Button } from 'antd';
import moment from 'moment';
import * as Apis from '../../apis/remind';

const getLabel = WeaLocaleProvider.getLabel;
const { TableStore } = WeaTableNew;

export default class RemindListItemStore {
    @observable params = {};
    @observable hidetop = 0;
    @observable reminds = [];
    @observable sellChanceId = '';
    @observable contactid = '';
    @observable workPlanId = '';
    @observable receivecof = '';
    @observable senderName = '';
    @observable senderAvator = '';
    @observable title = '';
    @observable createtime = '';
    @observable content = '';
    @observable type = '';
    @observable id = '';
    @observable role = '';
    @observable contactLogLayout = {};
    @observable createdate = '';
    @observable sender = '';
    @observable isUnder = '';
    @observable receverSpan = '';
    @observable receiver = '';
    @observable timedSende = '';
    @observable timedSendeState = '';
    @observable isSystem = '';
    @observable sndeDate = '';
    @observable sendeTime = '';
    @action
    doNew = (comObj) => {
      const { isUnder, sender, sellchanceid, contactid, workPlanId, receivecof, receverSpan, senderAvator, title,
        createtime, content, type, createdate, id, role, senderSpan, receiver, customerSpan, sellchanceSpan, contacter, contacterSpan, customer, timedSende, timedSendeState, isSystem, sndeDate, sendeTime } = comObj.props.item;
      this.sellChanceId = sellchanceid;
      this.contactid = contactid;
      this.workPlanId = workPlanId;
      this.receivecof = receivecof;
      this.senderName = senderSpan;
      this.senderAvator = senderAvator;
      this.title = title;
      this.createtime = createtime;
      this.content = content;
      this.type = type;
      this.id = id;
      this.role = role;
      this.sender = sender;
      this.createdate = createdate;
      this.isUnder = isUnder;
      this.receverSpan = receverSpan;
      this.receiver = receiver;
      this.customerSpan = customerSpan;
      this.contacter = contacter;
      this.contacterSpan = contacterSpan;
      this.customer = customer;
      this.sellchanceSpan = sellchanceSpan;
      this.timedSende = timedSende;
      this.timedSendeState = timedSendeState;
      this.isSystem = isSystem;
      this.sendeTime = sendeTime;
      this.sndeDate = sndeDate;
      // this.inIt();
    }
    @action
    saveRemindConf = () => {
      Apis.saveRemindConf({ id: this.id }).then((data) => {
        this.receivecof = '1';
      });
    }
}
